package org.siam.impl.schemas {
	
	import flash.utils.Dictionary;
	
	import org.siam.core.schemas.ISchemaProperty;

	public class SchemaProperty implements ISchemaProperty {
		
		public static const NULL:ISchemaProperty = new SchemaPropertyNull();
		
		internal var _id:String;
		internal var _metadata:Dictionary;
		internal var _formatterId:String;
		internal var _rendererId:String;
		
		public function SchemaProperty() {
			_metadata = new Dictionary();
		}
		
		public function get id():String {
			return _id;
		}

		public function findMetadata(metaKey:String):String { 
			return hasMetadata(metaKey) ? _metadata[metaKey] : null;
		}
		
		public function get formatterId():String {
			return _formatterId;
		}
		
		public function get rendererId():String {
			return _rendererId;
		}
		
		internal function registerMetadata(metaKey:String, metaValue:String):void { 
			_metadata[metaKey] = metaValue;
		}
		
		private function hasMetadata(metaKey:String):Boolean {
			return _metadata.hasOwnProperty(metaKey);
		}
	}
}